Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Lovely Website, Carry on the good work.

#36

Not sure why this started, it had been working fine, and no known changes in the data being processed.

https://gist.github.com/ae17ab0ff656db0f800c


You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.empty?

Trace:
ri_cal (0.8.8) lib/ri_cal/component/timezone.rb:105:in period_for_local' ri_cal (0.8.8) lib/ri_cal/component/timezone.rb:31:inrational_utc_offset'
ri_cal (0.8.8) lib/ri_cal/property_value/date_time/timezone_support.rb:61:in rational_tz_offset' ri_cal (0.8.8) lib/ri_cal/property_value/date_time.rb:312:inruby_value'
ri_cal (0.8.8) lib/ri_cal/properties/event.rb:597:in dtend' vendor/engines/fms_members/app/lib/import_events.rb:33:inblock (2 levels) in import'
...


UID: BEGIN:VEVENT
CREATED;VALUE=DATE-TIME:20110318T184134Z
DTEND;TZID=America/Denver;VALUE=DATE-TIME:20110318T220000
DTSTART;TZID=America/Denver;VALUE=DATE-TIME:20110318T180000
DTSTAMP;VALUE=DATE-TIME:20110516T224545Z
LAST-MODIFIED;VALUE=DATE-TIME:20110318T184134Z
UID:1459579@supersaas.com
DESCRIPTION:Grand Opening Event\nFluid Meeting Spaces
URL:http://www.supersaas.com/schedule/Fluid_Meeting_Spaces/FluidMeeting...
SUMMARY:Fluid Coffee Bar
END:VEVENT

Reported by candland · May 17th, 2011 @ 04:18 PM

State: new
Milestone: none
Assigned to: Rick DeNatale Rick DeNatale

Activity

  1. candland
    candland

    Seems like this method might be the issue: The problems seems to be that the ical feed doesn't have a STANDARD section, only a DAYLIGHT.

    /lib/ri_cal/component/timezone.rb:50

        # Returns the set of TimezonePeriod instances that are valid for the given
        # local time as an array. If you just want a single period, use
        # period_for_local instead and specify how ambiguities should be resolved.
        # Returns an empty array if no periods are found for the given time.
        def periods_for_local(local)
          local = local.to_ri_cal_date_time_value
          candidate_standard = last_before_local(standard, local)
          candidate_daylight = last_before_local(daylight, local)
          if candidate_daylight && candidate_daylight.swallows_local?(local, candidate_standard)
            []  # Invalid local time
          elsif candidate_standard
            if candidate_daylight
              if candidate_daylight.dtstart > candidate_standard.dtstart
                [candidate_daylight]
              elsif candidate_standard.ambiguous_local?(local)
                [candidate_daylight, candidate_standard]
              else
                [candidate_standard].compact
              end
            else
              [candidate_standard].compact
            end
          end
        end
    

    mst = <<MST
    BEGIN:VCALENDAR
    PRODID:-//SuperSaaS//Super Schedule//EN
    METHOD:PUBLISH
    VERSION:2.0
    CALSCALE:GREGORIAN
    X-WR-CALNAME:Fluid Meeting Space
    X-WR-TIMEZONE:America/Denver
    X-WR-RELCALID:40409
    BEGIN:VTIMEZONE
    TZID:America/Denver
    BEGIN:DAYLIGHT
    TZOFFSETFROM:-0700
    TZOFFSETTO:-0600
    DTSTART:20110313T030000
    RDATE:20110313T030000
    TZNAME:MDT
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    UID:1641738@supersaas.com
    DTSTAMP:20110519T192544Z
    DTSTART;TZID=America/Denver:20110428T120000
    DTEND;TZID=America/Denver:20110428T130000
    SUMMARY:Dusty
    DESCRIPTION:Test Meeting
    CREATED:20110428T210637Z
    LAST-MODIFIED:20110428T210637Z
    URL:http://www.supersaas.com/schedule/red27/Fluid_Meeting_Space?year=20...
    onth=4&day=28 END:VEVENT
    END:VCALENDAR
    MST

    Is this a ical issue or a ri_cal issue?

    May 20th, 2011 @ 12:14 PM

  2. candland
    candland

    Here's the code I ended up using.

    module RiCal
        class Component
            class Timezone < Component
                def periods_for_local(local)
                    puts "PATCHED Periods for local"
    
                    local = local.to_ri_cal_date_time_value
                    candidate_standard = last_before_local(standard, local)
                    candidate_daylight = last_before_local(daylight, local)
                    if candidate_daylight && candidate_daylight.swallows_local?(local, candidate_standard)
                        []  # Invalid local time
                    elsif candidate_standard
                        if candidate_daylight
                            if candidate_daylight.dtstart > candidate_standard.dtstart
                                [candidate_daylight]
                            elsif candidate_standard.ambiguous_local?(local)
                                [candidate_daylight, candidate_standard]
                            else
                                [candidate_standard].compact
                            end
                        else
                            [candidate_standard].compact
                        end
                    elsif candidate_daylight
                        [candidate_daylight]
                    end
                end
            end
        end
    end
    

    May 20th, 2011 @ 12:49 PM

  3. carlosbrab (at mail)
    carlosbrab (at mail)
    • Title changed from You have a nil object when you didn't expect it! - DTSTART to Lovely Website, Carry on the good work.
    • Assigned user set to Rick DeNatale

    Thank you! I value this.
    This is really interesting, You are a very skilled blogger. I have joined your rss feed and look forward to seeking more of your great post
    Here is my blog - http://www.onlinecigarettestoreus.com/

    January 18th, 2015 @ 05:27 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.